
import java.util.regex.*;
public class RegularExpression 
{
    private String afile_name;
    private String afile_type;
   
    public void Split_Name_Extension(String input_file_name)
    {
        String[] tokens = input_file_name.split("\\.");
        if(tokens.length >= 2)
        {
            afile_name = tokens[0];
            afile_type = tokens[1];         
        }
        else
        {
            System.out.print("\n File " + input_file_name + " not have extension");
        }
    }
    public boolean isCorrectUrlAddress(String url_address)
    {
        Pattern pattern = Pattern.compile("http://en.wikipedia.org/wiki/.*");
        Matcher matcher = pattern.matcher(url_address);
        return matcher.matches();
    }
    public String getFileName()
    {
        return afile_name;
    }
    public String getFileType()
    {
        return afile_type;
    }
    public String[] SplitStyudentsTable(String table_content)
    {
        Pattern pattern = Pattern.compile("\\s{1,}");
        String[] tokens = pattern.split(table_content);       
        return tokens;
    }
    public long splitTime(String output_time)
    {
        String replaces_output_time = output_time.replace(':', '.').substring(0, output_time.length() - 1);
        String[] tokens = replaces_output_time.split("\\.");
        long time = Long.parseLong(tokens[1])*60 + Long.parseLong(tokens[2]);      
        return time;
    }
}
